import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

async function main() {
  const transport = new StdioClientTransport({
    command: "node",
    args: ["dist/index.js"],
    cwd: "/Users/admin/Desktop/node-pty",
  });

  const client = new Client(
    {
      name: "debug-client",
      version: "1.0.0",
    },
    {
      capabilities: {
        roots: {},
        sampling: {},
      },
    },
  );

  await client.connect(transport);

  const tools = await client.listTools();
  console.log(JSON.stringify(tools, null, 2));

  await client.close();
  await transport.close();
}

main().catch((err) => {
  console.error("Error:", err);
  process.exit(1);
});
